package com.cy.store.mapper;

import com.cy.store.entity.User;
import org.apache.ibatis.annotations.Param;

import java.util.Date;

//@Mapper
public interface UserMapper {
    /**
     * 插入
     * @param user
     * @return
     */
    Integer insert(User user);

    /**
     * 查询
     * @param username
     * @return
     */
    User findByUsername(String username);

    /**
     * 根据uid修改密码
     * @param uid
     * @param password
     * @param modifiedTime
     * @return
     */
    Integer updatePasswordByUid(Integer uid, String password,String modifiedUser, Date modifiedTime);

    /**
     * 根据uid查询用户
     * @param uid
     * @return
     */
    User findByUid(Integer uid);

    /**
     * 修改个人信息
     * @param user
     * @return
     */
    public Integer updateInfoByUid(User user);

    /**
     * 根据uid更新头像信息
     * @param uid
     * @param avatar
     * @param modifiedUser
     * @param modifiedTime
     * @return
     */
    public Integer updateAvatarByUid( Integer uid,
                                      String avatar,
                                      String modifiedUser,
                                      Date modifiedTime);

                                      /*@Param("uid") Integer uid,
                                      @Param("avatar")String avatar,
                                      @Param("modifiedUser")String modifiedUser,
                                      @Param("modifiedTime")Date modifiedTime);*/
}
